import numpy as np

def beta_schedule(step_num):
    start = 1e-4
    end = 0.02

    return np.linspace(start, end, step_num)

def alpha(beta):
    return 1 - beta


def alpha_bar(beta):
    alpha_val = alpha(beta)
    res = []
    for i in range(len(beta)):
        one = np.prod(alpha_val[:i + 1])
        res.append(one)

    res = np.array(res)
    return res